using System;
using System.Collections;
using DoxyComment;
using System.ComponentModel;
using Microsoft.VisualStudio.VCCodeModel;

namespace TestProvider
{
	/// <summary>
	/// Summary description for TestProvider.
	/// </summary>
	[CommentProviderFriendlyName("Test Provider")]
	public class TestProvider : ICommentProvider
	{
		[CommentProviderProperty]
		private string someValue = "Default value";

		public TestProvider()
		{
		}
	
		[Category("Some category name"),
		Description("A description for the SomeValue property.")]
		public string SomeValue
		{
			get
			{
				return someValue;
			}
			set
			{
				someValue = value;
			}
		}

		#region ICommentProvider Members

		private string[] BuildComment(string txt)
		{
			ArrayList rv = new ArrayList();

			rv.Add("/*!");
			rv.Add(" * " + someValue);
			rv.Add(" * " + txt);
			rv.Add(" */");

			return (string[])rv.ToArray(typeof(string));
		}

		public string[] CreateNamespaceComment(Microsoft.VisualStudio.VCCodeModel.VCCodeNamespace codeElem)
		{
			// TODO:  Add Class1.CreateNamespaceComment implementation
			return BuildComment("Namespace comment");
		}

		public string[] CreateClassComment(Microsoft.VisualStudio.VCCodeModel.VCCodeClass codeElem)
		{
			// TODO:  Add Class1.CreateClassComment implementation
			return BuildComment("Class comment");
		}

		public string[] CreateFileComment(EnvDTE.Document doc,EnvDTE.Project proj)
		{
			// TODO:  Add Class1.CreateFileComment implementation
			return BuildComment("File comment");
		}

		public string[] CreateTypeDefComment(Microsoft.VisualStudio.VCCodeModel.VCCodeTypedef codeElem)
		{
			// TODO:  Add Class1.CreateTypeDefComment implementation
			return BuildComment("Typedef comment");
		}

		public string[] CreateEnumComment(Microsoft.VisualStudio.VCCodeModel.VCCodeEnum codeElem)
		{
			// TODO:  Add Class1.CreateEnumComment implementation
			return BuildComment("Enum comment");
		}

		public string[] CreateUnionComment(Microsoft.VisualStudio.VCCodeModel.VCCodeUnion codeElem)
		{
			// TODO:  Add Class1.CreateUnionComment implementation
			return BuildComment("Union comment");
		}

		public string[] CreateVariableComment(Microsoft.VisualStudio.VCCodeModel.VCCodeVariable codeElem)
		{
			// TODO:  Add Class1.CreateVariableComment implementation
			return BuildComment("Variable comment");
		}

		public string[] CreateMacroComment(Microsoft.VisualStudio.VCCodeModel.VCCodeMacro codeElem)
		{
			// TODO:  Add Class1.CreateMacroComment implementation
			return BuildComment("Macro comment");
		}

		public string[] CreateFunctionComment(Microsoft.VisualStudio.VCCodeModel.VCCodeFunction codeElem)
		{
			// TODO:  Add Class1.CreateFunctionComment implementation
			return BuildComment("Function comment");
		}

		public string[] CreateEnumValueComment(Microsoft.VisualStudio.VCCodeModel.VCCodeVariable codeElem)
		{
			// TODO:  Add Class1.CreateEnumValueComment implementation
			return BuildComment("Enum value comment");
		}

		public string[] CreateStructComment(Microsoft.VisualStudio.VCCodeModel.VCCodeStruct codeElem)
		{
			// TODO:  Add Class1.CreateStructComment implementation
			return BuildComment("Struct comment");
		}

		#endregion
	}
}
